import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    title: '猫眼',
    info: []
  },
  mutations: {
    changeTitle (state, title) {
    //   console.log(state.title)
      state.title = title
    // console.log(state.title)
    }
  //   search (state, keyword) {
  //     this.axios.get('search', {
  //       params: {
  //         kw: keyword,
  //         cityId: 20,
  //         stype: -1
  //       }
  //     }).then( result => {
  //       state.info = result
  //       console.log(state.info)
  //     })
  //   }
  },
  // actions: {

  // },
  getters: {
    getTitle (state) {
      var t = ''
      t = state.title
      return t
    }
  }
})
